package com.rs.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.rs.dao.ZhDepartmentMapper;
import com.rs.model.ZhDepartment;
import com.rs.service.ZhDepartmentService;

@Service
public class ZhDepartmentServiceImpl implements ZhDepartmentService {

	@Autowired
	private ZhDepartmentMapper zhDepartmentMapper;
	
	
	@Override
	public int insertSelective(ZhDepartment record) {
		//判断部门是否已存在
		if(null == zhDepartmentMapper.selectBydeName(record)){
			return zhDepartmentMapper.insertSelective(record);
		}else {
			return 0;
		}
		
	}

	@Override
	public int updateByPrimaryKeySelective(ZhDepartment record) {
		return 0;
	}

	@Override
	public ZhDepartment selectByPrimaryKey(Integer deId) {
		return null;
	}

	@Override
	public int deleteByPrimaryKey(Integer deId) {
		return 0;
	}

	@Override
	public List<ZhDepartment> selectByExample() {
		return zhDepartmentMapper.selectByExample();
	}

	@Override
	public ZhDepartment selectByName(ZhDepartment deName) {
		return zhDepartmentMapper.selectBydeName(deName);
	}

}
